package com.cloudnews.model.news;

import java.io.Serializable;

import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.jboss.solder.servlet.http.RequestParam;

@Named
@RequestScoped
public class StoryDetailHome implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Stories story = new Stories();
	
	
	@Inject
	@RequestParam
	private Long storyID;
	
	@PersistenceContext
	private EntityManager em;
	
	public String findStory(){
		story = em.find(Stories.class, storyID);
		return "/secure/storyDetail.xhtml";
	}

	public Stories getStory() {
		return story;
	}

	public void setStory(Stories story) {
		this.story = story;
	}
	

}
